package com.aiboleepro.base;


import com.github.pagehelper.PageInfo;

import java.io.Serializable;
import java.util.List;

/**
 * 通用的Service
 *
 * @author aiboleepro
 * @date 2018-08-26 下午5:28
 **/
public interface BaseService<T extends BaseObject, Id extends Serializable> {

    List<T> selectAll();

    List<T> select(T model);

    PageInfo<T> select(T model, int pageNum, int pageSize);

    T selectByPrimaryKey(Id id);

    int selectCount(T model);

    T selectOne(T model);

    int delete(T model);

    int deleteByPrimaryKey(Id id);

    boolean existsWithPrimaryKey(Id id);

    int insert(T model);

    int insertList(List<T> list);

    int insertSelective(T model);

    int updateByPrimaryKey(T model);

    int updateByPrimaryKeySelective(T model);
}
